Yet Another Optimization Article

نویسنده

  • Martin Fowler
چکیده

T his is a troubling column to write. I hadn't planned to write on optimization , because what I have to say has already been said numerous times. Yet, when I give talks, I find there's still a surprising number of people who don't know, or at least don't follow, the advice I'm about to give. So, here goes. (Many of you have probably seen this advice before—my thought to you is to ponder why I need to say this again.) First, performance matters. Although relying on Moore's law to get us out of slow programs has its merits, I find it increasingly annoying when I get a new version of a program and must upgrade my hardware for it to work acceptably. The question is, " How do we achieve a fast program? " For many programmers, performance is something you pay continuous attention to as you program. Every time you write a fragment of code, you consider the performance implications and code the program to maximize performance. This is an obvious technique—pity it works so badly. Performance is not something you can work on in this way. It involves specific discipline. Some performance work comes from architectural decisions, some from a more tactical optimization activity. But what both share is the fact that it is difficult to make decisions about performance from just looking at the design. Rather, you have to actually run the code and measure performance. Steps for optimization Optimizing an existing program follows a specific set of steps. First, you need a pro-filer—a program that can analyze how much time your program spends in its various parts. Software performance has an 80/20 rule: 80 percent of the program's time is spent on about 20 percent of the code. Trying to optimize performance in the 80 percent of code is futile, so the first order of business is to find that 20 percent of code. Trying to deduce where the program will spend its time is also futile. I know plenty of experienced programmers who always get this wrong. You have to use a profiler. To give the profiler something to chew on, perform some kind of automated run that reasonably simulates the program under its usual conditions. An automated test suite is a good starting point, but make sure you simulate the actual conditions. My colleague Dave Rice has a rule: " Never optimize a …

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Yet Another Application of the Theory of ODE in the Theory of Vector Fields

In this paper we are supposed to define the θ−vector field on the n−surface S and then investigate about the existence and uniqueness of its integral curves by the Theory of Ordinary Differential Equations. Then thesubject is followed through some examples.

متن کامل

A Complete Characterization of a Family of Solutions to a Generalized Fisher Criterion

Recently, Ye (2005) suggested yet another optimization criterion for discriminant analysis and proposed a characterization of the family of solutions to this objective. The characterization, however, merely describes a part of the full solution set, that is, it is not complete and therefore not at all a characterization. This correspondence first gives the correct characterization and afterward...

متن کامل

Enhanced PSO for Graph Coloring Problem

---------------------------------------------------------------------***--------------------------------------------------------------------Abstract— In this paper we have proposed a new Particle Swarm Optimization algorithm named Enhanced PSO. The proposed strategy consists of the concept of the Smallest Position Value rule. In this case the solution having the smallest position value will be ...

متن کامل

A Purely Geometric Approach to Non-Negative Matrix Factorization

We analyze the geometry behind the problem of non-negative matrix factorization (NMF) and devise yet another NMF algorithm. In contrast to the vast majority of algorithms discussed in the literature, our approach does not involve any form of constrained gradient descent or alternating least squares procedures but is of purely geometric nature. In other words, it does not require advanced mathem...

متن کامل

A Survey of New Directions in Database System

As database system research evolves, there are several enduring themes. One, of course, is how we deal with the largest possible amounts of data. A less obvious theme is optimization — it is an essential ingredient of all modern forms of database system. Because we deal with large volumes of data, we are often forced to process that data in regular ways. But when operations are uniform, there i...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • IEEE Software

دوره 19  شماره 

صفحات  -

تاریخ انتشار 2002